package svc

import (
	"github.com/zeromicro/go-zero/zrpc"
	"knowledge/api/internal/config"
	"knowledge/knowledgerpc/knowledgerpcclient"
)

type ServiceContext struct {
	Config       config.Config
	KnowledgeRpc knowledgerpcclient.Knowledgerpc
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:       c,
		KnowledgeRpc: knowledgerpcclient.NewKnowledgerpc(zrpc.MustNewClient(c.KnowledgeRpc)),
	}
}
